<?php use_javascript('/SXShopCartPlugin/js/shopCart/products.js') ?>
<?php include_partial('messages') ?>

<?php slot('page_title') ?>
Products
<?php end_slot() ?>
<?php $shopCardProducts = sfOutputEscaperArrayDecorator::unescape($sf_user->getAttribute('shopCart', array())); ?>
<div class="leftside left">


    <?php foreach ($products as $item): ?>
        <div class="item">
            <img src="/<?php echo sfConfig::get('app_product_dir_images') . '/' . $item->getImage() ?>" alt="" width="136" height="135" class="img-rounded" />
            <span class="itemName" title="<?php echo $item ?>"> <?php echo setStringLengthString($item) ?> </span>

            <span class="itemPrice"> $ <?php echo $item->getPrice() ?> </span>
            <span class="qty"><label>Qty</label><input class="quantity" type="text" value="<?php echo isset($shopCardProducts[$item->getId()]) ? $shopCardProducts[$item->getId()] : '' ?>"></span>

            <a class="addtoCart button  addToShopCart button" href="<?php echo url_for('AddToShopCart', array('pid' => $item->getId())) ?>"><b class="plus"> + </b>Add to cart</a>
        </div>
    <?php endforeach ?>

</div>
<div class="rightside right">
    <div id="shopCartComp">
        <?php include_component('shopCart', 'shopCartProductsList') ?>
    </div>
    <a class="clearShopCart button" href="<?php echo url_for('ClearShopCart') ?>">Clear shop cart</a>
</div>

